
import { MallModel } from '../models/mall'

export class MallService {
  constructor() {
    this.mallModel = new MallModel()
    this.key = Math.random()
  }
  // 获取商品列表
  async getGoodsList(params) {
    return await this.mallModel.getGoodsList(params)
  }
  // 获取商品详情
  async getGoodsDetail(params) {
    return await this.mallModel.getGoodsDetail(params)
  }
  // 获取订单列表
  async getOrderList(params) {
    return await this.mallModel.getOrderList(params)
  }
  // 获取购物金记录列表
  async getRecordList(params) {
    return await this.mallModel.getRecordList(params)
  }
  // 创建淘礼金
  async createTaobaoGift(params) {
    return await this.mallModel.createTaobaoGift(params)
  }

  async setAcceptPrivacy(accept) {
    this.mallModel.setAcceptPrivacy(accept)
  }

  async isAcceptPrivacy() {
    return await this.mallModel.isAcceptPrivacy()
  }
}